Optimal. Leaf size=96 \[ -\frac{a (d \cot (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\cot ^2(e+f x)\right )}{d f (n+1)}-\frac{b (d \cot (e+f x))^n \, _2F_1\left (1,\frac{n}{2};\frac{n+2}{2};-\cot ^2(e+f x)\right )}{f n} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.120387, antiderivative size = 96, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3673, 3538, 3476, 364} \[ -\frac{a (d \cot (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\cot ^2(e+f x)\right )}{d f (n+1)}-\frac{b (d \cot (e+f x))^n \, _2F_1\left (1,\frac{n}{2};\frac{n+2}{2};-\cot ^2(e+f x)\right )}{f n} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3673
Rule 3538
Rule 3476
Rule 364
Rubi steps
\begin{align*} \int (d \cot (e+f x))^n (a+b \tan (e+f x)) \, dx &=d \int (d \cot (e+f x))^{-1+n} (b+a \cot (e+f x)) \, dx\\ &=a \int (d \cot (e+f x))^n \, dx+(b d) \int (d \cot (e+f x))^{-1+n} \, dx\\ &=-\frac{(a d) \operatorname{Subst}\left (\int \frac{x^n}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{f}-\frac{\left (b d^2\right ) \operatorname{Subst}\left (\int \frac{x^{-1+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{f}\\ &=-\frac{b (d \cot (e+f x))^n \, _2F_1\left (1,\frac{n}{2};\frac{2+n}{2};-\cot ^2(e+f x)\right )}{f n}-\frac{a (d \cot (e+f x))^{1+n} \, _2F_1\left (1,\frac{1+n}{2};\frac{3+n}{2};-\cot ^2(e+f x)\right )}{d f (1+n)}\\ \end{align*}
Mathematica [A] time = 0.195702, size = 88, normalized size = 0.92 \[ -\frac{(d \cot (e+f x))^n \left (a n \cot (e+f x) \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\cot ^2(e+f x)\right )+b (n+1) \, _2F_1\left (1,\frac{n}{2};\frac{n+2}{2};-\cot ^2(e+f x)\right )\right )}{f n (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.597, size = 0, normalized size = 0. \begin{align*} \int \left ( d\cot \left ( fx+e \right ) \right ) ^{n} \left ( a+b\tan \left ( fx+e \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \cot{\left (e + f x \right )}\right )^{n} \left (a + b \tan{\left (e + f x \right )}\right )\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]